<template>
	<view class="container">
		<m-header class="top" @click="detailCompany" :list="adDatas"></m-header>
		<view class="shuzi u-m-t-20">
			<view class="count u-p-t-36 u-p-b-10 u-flex u-row-center">
				<u-count-to class="count-to" ref="uCountTo" :autoplay="autoplay" :startVal="startVal" :endVal="endVal" :duration="duration"
				 :decimals="decimals" :bold="bold" :fontSize="fontSize" :color="color"></u-count-to>
				<text class="u-m-l-10">名优秀伙伴为您服务</text>
			</view>

			<u-form :model="model" :rules="rules" ref="uForm" :errorType="errorType">
				<u-form-item class="group"  :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我是" prop="iam">
					<u-input :border="border" type="select" v-model="model.iam" placeholder="请选择" placeholderStyle="color: #4B9CFF;"
					 input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="group"  :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我需要" prop="imean">
					<picker @change="bindPickerImeanChange" :value="iindex" :range="teamlbs" style="width:100%;text-align: right;">
						<view style="color: #4B9CFF;" class="uni-input">{{model.wxy || "请选择"}}</view>
					</picker>
				</u-form-item>
				<u-form-item class="group" :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我意向" prop="wyx">
					<view style="flex: 1;text-align: right;" @click="handleWyx">
						<u-icon name="arrow-right" style="color:#9DA2B0;font-size: 32upx;"></u-icon>
					</view>
				<!-- 	<picker @change="bindPickerPpdxChange" :value="zindex" :range="ppdxs" style="width:100%;text-align: right;">
						<view style="color: #4B9CFF;" class="uni-input">{{model.wyx || "请选择"}}</view>
					</picker> -->
				</u-form-item>

				<block v-if="model.demand">
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition" label="名称" prop="name">
						<u-input :border="border" placeholder="请输入" v-model="model.demand.name" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="团长地域" prop="leaderArea">
						<u-input type="select" :select-open="selectShowQydz" v-model="model.demand.leaderArea" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right" @click="selectShowQydz = true"></u-input>
						 <u-select :default-value="defaultValue" v-model="selectShowQydz" mode="mutil-column-auto" value-name="value" label-name="name" child-name="submenu" :list="listCitys" @confirm="confirmCity"></u-select>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="团队类型" prop="teamType">
						<view style="width:100%;text-align: right;" @click="choooseType">{{model.demand.teamType || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="团队数量" prop="num">
						<u-input :border="border" type="number" v-model="model.demand.num" placeholder="请输入" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>					
					<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="诚信保证金" prop="integrityDeposit">
						<u-input :border="border" placeholder="" v-model="model.demand.integrityDeposit" type="text" input-align="right"></u-input><block v-if="model.demand.integrityDeposit > 0">元</block><block v-else>不需要</block>
					</u-form-item>
				<view v-if="model.demand.mode == '企业合作'" class="">
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="类别" prop="lb">
						<u-input :border="border" type="select" v-model="model.demand.lb" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="地域" prop="region">
						<u-input type="select" v-model="model.demand.region" placeholder="请选择" placeholderStyle="color: #0D1D36;" input-align="right"></u-input>

					</u-form-item>
					<u-gap :bg-color="bgColor" :height="height" :required="required" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
					<view class="qtsm u-m-l-40 u-m-r-30 u-m-t-40">
						<image src="../../static/img/releasesm.png" style="width: 29rpx; height: 29rpx;" mode=""></image>
						<text class="hz">简短说明</text>
					</view>
					<u-form-item class="  zwpj u-m-l-30 u-m-r-30 "  :label-position="labelPosition" prop="jdsm">
						<u-input type="textarea" :border="border" placeholder="请输入简短说明" v-model="model.demand.jdsm" />
					</u-form-item>
				</view>
				<view v-if="model.demand.mode == '服务合作'" class="">
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="类别" prop="lb">
						<u-input :border="border" type="select" v-model="model.demand.lb" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="服务内容" prop="fwnr">
						<u-input :border="border" type="select" v-model="model.demand.fwnr" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-gap :bg-color="bgColor" :height="height" :required="required" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
					<view class="qtsm u-m-l-40 u-m-r-30 u-m-t-40">
						<image src="../../static/img/releasesm.png" style="width: 29rpx; height: 29rpx;" mode=""></image>
						<text class="hz">简短说明</text>
					</view>
					<u-form-item class="  zwpj u-m-l-30 u-m-r-30 "  :label-position="labelPosition" prop="jdsm">
						<u-input type="textarea" :border="border" placeholder="请输入简短说明" v-model="model.demand.jdsm" />
					</u-form-item>
				</view>
				<view v-if="model.demand.mode == '融资合作'" class="">

					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="项目地域" prop="region">
						<u-input type="select" v-model="model.demand.region" placeholder="请选择" placeholderStyle="color: #0D1D36;" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="项目类别" prop="lb">
						<u-input :border="border" type="select" v-model="model.demand.lb" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="用地面积" prop="ydmj">
						<u-input :border="border" placeholder="请输入  亩" v-model="model.demand.ydmj" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="建筑面积" prop="jzmj">
						<u-input :border="border" placeholder="请输入" v-model="model.demand.jzmj" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="进展阶段" prop="jzjd">
						<u-input :border="border" type="select" v-model="model.demand.jzjd" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="融资规模" prop="rzgm">
						<u-input :border="border" placeholder="请输入" v-model="model.demand.rzgm" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="融资方式" prop="rzfs">
						<u-input :border="border" type="select" v-model="model.demand.rzfs" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="时间安排" prop="sjap">
						<u-input :border="border" placeholder="请选择" placeholderStyle="color: #0D1D36;" v-model="model.demand.sjap" type="text"
						 input-align="right"></u-input>
						<u-calendar v-model="show" ref="calendar" @change="change" :mode="mode" :start-text="startText" :end-text="endText"
						 :range-color="rangeColor" max-date="2022-10-01" :range-bg-color="rangeBgColor" :active-bg-color="activeBgColor">
						</u-calendar>

					</u-form-item>
					<view class="qtsm u-m-l-40 u-m-r-30 u-m-t-40">
						<image src="../../static/img/releasesm.png" style="width: 29rpx; height: 29rpx;" mode=""></image>
						<text class="hz">简短说明</text>
					</view>
					<u-form-item class="  zwpj u-m-l-30 u-m-r-30 "  :label-position="labelPosition" prop="jdsm">
						<u-input type="textarea" :border="border" placeholder="请输入简短说明" v-model="model.demand.jdsm" />
					</u-form-item>
				</view>
				</block>
				<block v-if="model.intention == 11 && model.iam == '个人'">
				
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="产业" prop="industry">
							<view style="width:100%;text-align: right;">{{model.intention.industry || "请选择"}}</view>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="个人身份" prop="userIdentify">
							<view style="width:100%;text-align: right;">{{model.intention.userIdentify || "请选择"}}</view>
						</u-form-item>
						<block v-if="model.wxy != '学习团队'">
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="具体身份" prop="specialty">
							<view style="width:100%;text-align: right;">{{model.intention.specialty || "请选择"}}</view>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="职称" prop="profession">
							<view class="value" style="width:100%;text-align: right;">{{model.intention.profession || "请选择职称"}}</view>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="执业资格" prop="credentials">
							<view class="value" style="width:100%;text-align: right;">{{model.intention.credentials || "请选择职称"}}</view>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="擅长领域" prop="expertise">
							<view style="width:100%;text-align: right;">{{model.intention.expertise || "请选择"}}</view>
						</u-form-item>
						<u-form-item v-if="model.intention.professional != undefined" class="u-m-l-30 u-m-r-30" label-width="200"  label="专业方向" prop="professional">
							<view style="width:100%;text-align: right;">{{model.intention.professional || "请选择"}}</view>
						</u-form-item>
						</block>
						<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
						 :border-bottom="true" label="地域" prop="region">
							<u-input type="select" v-model="model.intention.region" placeholder="请选择" placeholderStyle="color: #0D1D36;"
							 input-align="right"></u-input>
						</u-form-item>
						<block v-if="model.wxy != '学习团队'">
						<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
						 :border-bottom="true" label="性别" prop="gender">
							<u-input :border="border" type="select" v-model="model.intention.gender" placeholder="请选择"
							 placeholderStyle="color: #0D1D36;" input-align="right"></u-input>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
						 :border-bottom="true" label="学历" prop="requireEdu">
							<u-input :border="border" type="select" v-model="model.intention.requireEdu" placeholder="请选择"
							 placeholderStyle="color: #0D1D36;" input-align="right"></u-input>
						</u-form-item>
						<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-position="labelPosition" label="在职情况"
						 label-width="490" prop="incumbency">
						 <view style="width:100%;text-align: right;">{{model.intention.incumbency || "请选择"}}</view>
						</u-form-item>
						</block>
					
					
				</block>
				
				<block v-if="model.intention == 11 && model.iam == '企业'">

					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="地域" prop="area">
						<u-input type="select" v-model="model.intention.area" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition" label="企业性质" prop="enterpriseNature">
						<u-input type="select" v-model="model.intention.enterpriseNature" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="擅长领域" prop="enterpriseField">
						<u-input :border="border" type="select" v-model="model.intention.enterpriseField" placeholder="请选择"
						 placeholderStyle="color: #0D1D36;" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="企业领域" prop="corporateIdentity">
						<view style="width:100%;text-align: right;">{{model.intention.corporateIdentity || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="企业资质" prop="qualification">
						<u-input :border="border" type="select" v-model="model.intention.qualification" placeholder="请选择"
						 placeholderStyle="color: #0D1D36;" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="质量体系" prop="qualitySystem">
						<u-input :border="border" placeholder="请输入" v-model="model.intention.qualitySystem" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item v-if="model.intention.zsbzj != undefined" class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="诚信保证金"
					 prop="integrityDeposit">
						<u-input :border="border" placeholder="请输入保证金金额  元" v-model="model.intention.integrityDeposit" type="text"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="履约信誉" prop="performanceReputation">
						<u-input :border="border" placeholder="请输入" v-model="model.intention.performanceReputation" type="text"
						 input-align="right"></u-input>
					</u-form-item>
				</block>
				
				<block v-if="model.wxy == '学习团队'">
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200"
					:label-position="labelPosition" :border-bottom="true" label="课程分类" prop="fblx">
						<view style="width:100%;text-align: right;">{{model.kcfl || "请选择"}}</view>
						</u-form-item>
						<block v-if="model.kcfl == '专家课程' || model.kcfl == '牛人课程'">
						<!-- 	<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="产业" prop="industry">
								<view style="width:100%;text-align: right;" @click="cySelect">{{model.industry || "请选择"}}</view>
							</u-form-item> -->
							<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
							 :border-bottom="true" label="专业方向" prop="specialty">
								<view style="width:100%;text-align: right;">{{model.specialty || "请选择"}}</view>
							</u-form-item>
							<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
							 :border-bottom="true" label="课程内容" prop="kcnr">
								<view style="width:100%;text-align: right;">{{model.kcnr || "请选择"}}</view>
							</u-form-item>
					
						</block>
						<block v-if="model.kcfl == '高校课堂'">
							<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
							 :border-bottom="true" label="专业方向" prop="specialty">
							<view style="width:100%;text-align: right;">{{model.specialty || "请选择"}}</view>
							</u-form-item>
						</block>
						<block v-if="model.kcfl == '培训机构课堂'">
							<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
							 :border-bottom="true" label="阶段" prop="specialty">
								<view style="width:100%;text-align: right;">{{model.jd || "请选择"}}</view>
							</u-form-item>
						</block>
						<block v-if="model.kcfl == '职业教育培训'">
							<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
							 :border-bottom="true" label="培训方向" prop="specialty">
								<view style="width:100%;text-align: right;">{{model.pxfx || "请选择"}}</view>
							</u-form-item>
						</block>
					<u-form-item class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition" :border-bottom="false"
					 label="时间预告" prop="sjyg">
						<u-input :border="border" placeholder="请选择" v-model="model.sjyg" type="text" input-align="right"></u-input>
					</u-form-item>
				</block>
				<u-gap :bg-color="bgColor" :height="height" :required="required" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
				<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :required="required" :label-position="labelPosition" label="关键字"
				 prop="gjz">
					<u-input :border="border" placeholder="请输入" v-model="model.gjz" type="text" input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="屏蔽关键字" prop="pbgjz">
					<u-input :border="border" placeholder="请输入" v-model="model.pbgjz" type="text" input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition" :border-bottom="false"
				 label="匹配时效" prop="ppsx">
					<u-input :border="border" @click="show = true" placeholder="请选择" v-model="model.ppsx" type="text" input-align="right"></u-input>
					<u-calendar v-model="show" ref="calendar" @change="change" :mode="mode" :start-text="startText" :end-text="endText"
					 :range-color="rangeColor" max-date="2022-10-01" :range-bg-color="rangeBgColor" :active-bg-color="activeBgColor">
					</u-calendar>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition" :border-bottom="false"
				 label="匹配权重" prop="customize">
					<view style="flex: 1;text-align: right;" @click="handleClickWeight()">
						<u-icon name="arrow-right" style="color:#9DA2B0;font-size: 32upx;"></u-icon>
					</view>
				</u-form-item>
				<u-gap :bg-color="bgColor" :height="height" :margin-bottom="marginBottom"></u-gap>
				<view class="qtsm u-m-l-40 u-m-r-30 u-m-t-40">
					<image src="../../static/img/releasesm.png" style="width: 29rpx; height: 29rpx;" mode=""></image>
					<text class="hz">其他说明</text>
				</view>
				<u-form-item class="  zwpj u-m-l-30 u-m-r-30 " :label-position="labelPosition" prop="qtsm">
					<u-input type="textarea" :border="border" placeholder="请输入其他说明" v-model="model.qtsm" />
				</u-form-item>
			</u-form>
		</view>
		<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
		<view class="list u-m-t-50">
			<view class="u-flex u-row-between u-p-20">
				<view>
					<image src="../../static/img/qiye.png"></image>
					<text class="title u-m-l-30 " v-if="model.iam == '个人'">人员要求</text>	<text class="title u-m-l-30" v-else>企业要求</text>
				</view>
				<view>
					<button size="mini" @click="handleWyx"  class="add">添加</button>
				</view>
			</view>
			<view class="p-item u-border-bottom u-line-1" v-for="(item,index) in model.intention" :key="index">
				<text class="u-p-10" style="color:#F76260" @click="delIntention(index)">x</text>
				{{getStr(item)}}
			</view>
		</view>
		<view class="warp u-m-t-20 u-p-30">
			<u-button class="button" @click="submit">马上为我匹配</u-button>
			<!--弹出框-->
			<u-select mode="single-column" :list="wsList" v-model="selectShowWs" @confirm="selectConfirmWs"></u-select>
			<u-select mode="single-column" :list="wxyList" v-model="selectShowWxy" @confirm="selectConfirmWxy"></u-select>
			<u-select mode="single-column" :list="wyxList" v-model="selectShowWyx" @confirm="selectConfirmWyx"></u-select>
			<u-select mode="single-column" :list="dataList" v-model="selectShowPpsx" @confirm="selectConfirmPpsx"></u-select>
			<u-select mode="single-column" :list="gzddList" v-model="selectShowGzdd" @confirm="selectConfirmGzdd"></u-select>
			<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
			<u-select :default-value="defaultValue" v-model="selectShowQydz" mode="mutil-column-auto" value-name="value" label-name="name" child-name="submenu" :list="listCitys" @confirm="confirmCity"></u-select>
			<!--弹出框-->
		</view>
	</view>
</template>
<script>
	import TriTree from '@/components/tki-tree/tki-tree.vue'
	export default {
		components: {
			TriTree
		},
		data() {
			let that = this;
			return {
				adDatas:[],
				iindex:0,
				teamlbs:["请选择","方舟工程","法律服务","学习团队"],
				zindex:0,
				ppdxs:["请选择","个人","企业","团队"],
				fetchDict: [],
				//选择城市
				selectShowQydz: false,
				showCity: false,
				defaultValue: [3],
				listCitys: [],
				height: 20,
				bgColor: this.$u.color.bgColor,
				marginTop: 30,
				marginBottom: 30,
				show: false,
				mode: 'date',
				result: "",
				startText: '开始',
				endText: '结束',
				rangeColor: '#2979ff',
				rangeBgColor: 'rgba(41,121,255,0.13)',
				activeBgColor: '#2979ff',
				btnType: 'primary',
				zsbzj: false,
				zstdlx: 0,
				/**
				 * form验证
				 * */
				model: {},
				params: {},
				selectList: [{
						value: '测试1',
						label: '测试1'
					},
					{
						value: '测试2',
						label: '测试2'
					},
					{
						value: '测试3',
						label: '测试3'
					}
				],
				dataList: [{
						value: '2020-11-10',
						label: '2020-11-10'
					},
					{
						value: '2020-12-10',
						label: '2020-12-10'
					},
					{
						value: '2020-12-20',
						label: '2020-12-20'
					}
				],
				gzddList: [{
						value: '武汉',
						label: '武汉'
					},
					{
						value: '上海',
						label: '上海'
					},
					{
						value: '北京',
						label: '北京'
					}
				],
				wsList: [{
						value: '个人',
						label: '个人'
					},
					{
						value: '企业',
						label: '企业'
					}
				],
				wxyList: [],
				wyxList: [],
				checkboxListTwo: [

					{
						name: '需要',
						checked: false,
						disabled: false
					},
					{
						name: '不需要',
						checked: false,
						disabled: false
					},
				],
				checkboxListOne: [

					{
						name: '面向个人',
						checked: false,
						disabled: false
					},
					{
						name: '面向企业',
						checked: false,
						disabled: false
					},
				],
				rules: {
					ws: [{
						required: false,
						message: '请选择我是',
						trigger: 'change'
					}],
					wxy: [{
						required: false,
						message: '请选择我需要',
						trigger: 'change'
					}],
					wyx: [{
						required: false,
						message: '请选择我意向',
						trigger: 'change'
					}],
					tdm: [{
						required: false,
						message: '请输入团队名',
						trigger: 'change'
					}],
					region: [{
						required: false,
						message: '请选择工作地点',
						trigger: 'change',
					}],
					gjz: [{
						required: false,
						message: '请输入关键字',
						trigger: 'change',
					}]
				},
				required: false,
				border: false,
				check: false,
				region: '',
				selectStatus: 'close',
				selectShowZyp: false,
				selectShowWs: false,
				selectShowWxy: false,
				selectShowWyx: false,
				selectShowPpsx: false,
				selectShowGzdd: false,
				selectShowQydy: false,
				selectShowLyxy: false,
				pickerShow: false,
				labelPosition: 'left',
				codeTips: '',
				errorType: ['toast'],
				radio: '',
				radio1: '',
				radioCheckWidth: 'auto',
				radioCheckWrap: false,
				/**/

				/**
				 * 数字统计
				 * */
				startVal: 500,
				endVal: 500,
				separator: ',',
				decimals: 0,
				duration: 2000,
				autoplay: true,
				useEasing: true,
				current: 3,
				isStop: false,
				bold: false,
				fontSize: 24,
				color: '#fff',
				/**/
				keyIndex: 0,
				keywords: [{
					name: '企业',
					selected: true
				}, {
					name: '设计师',
					selected: false
				}, {
					name: '监理',
					selected: false
				}, {
					name: '大型企业',
					selected: false
				}, {
					name: '采购',
					selected: false
				}, {
					name: '监理',
					selected: false
				}]
			};
		},
		mounted() {

		},
		onShow() {
			let identity = this.$store.state.userInfo.identityType;
			if (identity == 0) {
				this.model.iam = "个人";
			} else if (identity == 1) {
				this.model.iam = "企业";
				this.teamlbs=["请选择","方舟工程"];
			} else {}
			
		},
		onLoad(options) {
			if (options.data) {
				let data = JSON.parse(decodeURIComponent(options.data));
				console.log('data',data);
				this.model = data;
				//this.model.wxy = data.mode;
			}
			if (options.row) {
				this.model = JSON.parse(decodeURIComponent(options.row));
			}
			console.log("model",this.model);
			//获取省市区
			this.cityList();
			this.dictionaryFetchDict('group_type');
			this.findfetchAd(1);
			this.findextraIndex();
		},
		onReady() {

		},
		methods: {	
			async detailCompany(e){
				console.log(e);
				let result = await this.$apis.updateAdViewCount({id:e.model.id});
			},
			getStr(obj){
				console.log(obj);
				var str = [];
				Object.keys(obj).forEach(function(key){
					if(obj[key] !== '' && obj[key] != undefined) str.push(obj[key]);
				     console.log(key,obj[key]);
				});
				return str.join('/');
			},
			delIntention(index){
				this.$delete(this.model.intention,index);
			},
			async findextraIndex(){
				let result = await this.$apis.extraIndex();
				this.endVal = this.endVal + result.data;
			},	
			async findfetchAd(type){
				let result = await this.$apis.fetchAd({type:type});
				this.adDatas = result.data;
			},	
			bindPickerPpdxChange(e){
				console.log(e.detail.value)
				this.zindex = e.detail.value;
				this.model.wyx = this.ppdxs[e.detail.value];
				if (this.zindex == 2) {
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/wyxContent?row=" + encodeURIComponent(JSON.stringify(this.model))
					})
				} else {
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/personalWyxContent?row=" + encodeURIComponent(JSON.stringify(this.model))
					})
				}
			},
			bindPickerImeanChange(e){	
				this.iindex = e.detail.value;
				this.model.wxy = this.teamlbs[e.detail.value];	
						console.log("model",this.model);
				// if(this.model.wxy == '学习团队'){
				// 	this.iindex = 0;
				// 	this.model.wxy = '';
				// 	uni.showToast({
				// 		title: "开发中",
				// 		icon: "none"
				// 	})
				// 	return;
				// }
				if (this.model.iam === undefined) {
					uni.showToast({
						title: "请选择我是",
						icon: "none"
					})
				} else {
					if (this.model.iam == "个人") {
				
						this.$mRouter.push({
							route: this.$mRoutesConfig.teamNeed,
							query: {
								data: encodeURIComponent(JSON.stringify(this.model))
							}
						})
					} else {
						uni.navigateTo({
							url: "../wisdomcommune/teamSelect/wxyContent?data=" + encodeURIComponent(JSON.stringify(this.model))
						})
					}
				}
			},
			async dictionaryFetchDict(keyWords) {
				let result = await this.$apis.dictGroup({
					dictCode: keyWords
				});
				this.fetchDict[keyWords] = result.data;
			},
			setChooseType(item, type) {
				this.model[type] = item[0].label
				if (type == 'teamType') {
					this.model.teamTypeId = item[0].value;
				}
				this.$forceUpdate()
				console.log("setChooseType", item, type);
			},
			choooseType() {
				this.$refs.triTree._show()
			},
			toimean() {
				if (this.model.iam === undefined) {
					uni.showToast({
						title: "请选择我是",
						icon: "none"
					})
				} else {
					if (this.model.iam == "个人") {

						this.$mRouter.push({
							route: this.$mRoutesConfig.teamNeed,
							query: {
								data: encodeURIComponent(JSON.stringify(this.model))
							}
						})
					} else {
						uni.navigateTo({
							url: "../wisdomcommune/teamSelect/wxyContent?data=" + encodeURIComponent(JSON.stringify(this.model))
						})
					}
				}
			},
			handleWyx() {
				let identity = this.$store.state.userInfo.identityType;
				if (identity == 1) {
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/wyxContent?row=" + encodeURIComponent(JSON.stringify(this.model))
					})
				} else if (identity === 0) {
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/personalWyxContent?row=" + encodeURIComponent(JSON.stringify(this.model))
					})
				} else {
					uni.showToast({
						title: '请先选择我需要',
						icon: 'none'
					});
				}
			},
			handleClickWeight(e) {
				var model = encodeURIComponent(JSON.stringify(this.model));
				let url = encodeURIComponent(JSON.stringify("wisdomcommune/zhihuiTeam"));
				if (this.model.wyx == '企业') {
					uni.navigateTo({
						url: '../user/companyWeight?type=' + url + '&row=' + model
					})
				} else if (this.model.wyx == '团队') {
					uni.navigateTo({
						url: '../user/teamWeight?type=' + url + '&row=' + model
					})
				} else {
					uni.navigateTo({
						url: '../user/personWeight?type=' + url + '&row=' + model
					})
				}
			},
			confirmCity(e) {
				this.model.leaderArea = '';
				e.map((val, index) => {
					this.model.leaderArea += this.model.leaderArea == '' ? val.label : '-' + val.label;
				})
			},
			async cityList() {
				let result = await this.$apis.fetchArea({level:2});	
				this.listCitys = result.data;
			},
			toAdd() {
				let data = this.model;
				data.type = "tuandui";
				let query = encodeURIComponent(JSON.stringify(data))
				uni.navigateTo({
					url: "/pages/wisdomcommune/personAsk?data=" + query
				})
			},
			// checkbox选择发生变化
			checkboxGroupChange(e) {
				// debugger
				if (e === "需要") {
					this.zsbzj = true;
				} else {
					this.zsbzj = false;
				}

			},
			// checkbox选择发生变化
			checkboxGroupChange1(e) {
				if (e === "面向个人") {
					this.zstdlx = 0;
				} else {
					this.zstdlx = 1;
				}
			},
			// 创建团队
			async submit() {
				if (this.model.wxy == undefined) {
					uni.showToast({
						title: "请选择我需要",
						icon: 'none'
					});
					return;
				}
				this.model.name = this.model.demand.name;
				this.$delete(this.model,"teamCompany");
				let data = await this.$apis.teamMatching(this.model);
				if (data.code == 200) {
					uni.showToast({
						title: data.message,
						icon: 'none'
					});
					setTimeout(() => {
						this.$mRouter.switchTab({
							route: this.$mRoutesConfig.message
						});
					}, 2000)

				} else {
					uni.showToast({
						title: data.msg,
						icon: 'none'
					});
					return;
				}
			},
			//团队匹配并新增
			async matching() {
				try {
					let reqBody = {};
					let data = await this.$apis.teamMatching(this.model);
					if (data.code == 200) {
						uni.showToast({
							title:"信息发布匹配成功",
							icon: 'none'
						});
						setTimeout(() => {
							this.$mRouter.switchTab({
								route: this.$mRoutesConfig.message
							});
						}, 2000)

					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none'
						});
						return;
					}
				} catch (e) {
					console.log(e);
					this.submitBtnDis = false;
				}
			},
			//查询匹配 我是  字典数据
			async wsDictionary() {
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我是";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wsValue = {};
					wsValue['value'] = list[i].id;
					wsValue['label'] = list[i].name;
					this.wsList.push(wsValue)
				}
			},
			//查询匹配 我需要  字典数据
			async wxyDictionary() {
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我需要";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wxyValue = {};
					wxyValue['value'] = list[i].id;
					wxyValue['label'] = list[i].name;
					this.wxyList.push(wxyValue)
				}
			},
			//查询匹配 我意向  字典数据
			async wyxDictionary() {
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我意向";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wyxValue = {};
					wyxValue['value'] = list[i].id;
					wyxValue['label'] = list[i].name;
					this.wyxList.push(wyxValue)
				}
			},
			selectKey(e) {
				this.keywords[e].selected = !this.keywords[e].selected;
			},
			// 选择地区回调
			regionConfirm(e) {
				this.model.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
			},
			// 选择
			selectConfirmWs(e) {
				this.model.ws = '';
				e.map((val, index) => {
					this.model.ws += this.model.ws == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmWxy(e) {
				let identity = this.$store.state.userInfo.identityType
				if (identity == 0) {
					let query = e[0].value;
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/personalWxyContent?data=" + query
					})
				} else if (identity == 1) {
					uni.navigateTo({
						url: "/pages/wisdomcommune/teamSelect/pattern"
					})
				}
				console.log(e);
				this.model.wxy = '';
				e.map((val, index) => {
					this.model.wxy += this.model.wxy == '' ? val.label : '-' + val.label;
					this.model.type = val.value;
				});
			},
			selectConfirmWyx(e) {
				this.model.wyx = '';
				e.map((val, index) => {
					this.model.wyx += this.model.wyx == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmPpsx(e) {
				this.model.ppsx = '';
				e.map((val, index) => {
					this.model.ppsx += this.model.ppsx == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmGzdd(e) {
				this.model.region = '';
				e.map((val, index) => {
					this.model.region += this.model.region == '' ? val.label : '-' + val.label;
				});
			},
			change(e) {
				this.model.ppsx = e.result;
			},
			dianji() {
				this.show = true;
			},
			selectConfirmQydy(e) {
				this.model.qydy = '';
				e.map((val, index) => {
					this.model.qydy += this.model.qydy == '' ? val.label : '-' + val.label;
				});
			}
		}
	};
</script>
<style scoped lang="scss">
	page {
		background: #ffffff;
	}

	.top {
		width: 100%;
		height: 260rpx;
		background: $uni-bg-color-ad;

		.above {
			display: flex;
			justify-content: center;
			margin-left: -46rpx;

			.picture {
				width: 117.8rpx;
				height: 137.4rpx;
				margin-left: 20rpx;
				margin-top: 20rpx;
			}
		}

		.below {
			display: flex;
			justify-content: center;
			margin-left: -46rpx;
			margin-top: -20rpx;

			.picture {
				width: 117.8rpx;
				height: 137.4rpx;
				margin-left: 20rpx;
				margin-top: 1rpx;
			}
		}
	}

	.count {
		margin-top: -50rpx;
		width: 100%;
		height: 100rpx;
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0rpx 0rpx;

		.count-to {
			font-size: 24rpx;
		}

		text {
			padding: 2rpx 12rpx;
			background: #ff9e21;
			color: #ffffff;
			font-size: 24rpx;
		}
	}

	.fgx {
		width: 100%;
		height: 20rpx;
		background-color: #F5F5F9;
		margin-top: 40rpx;
	}

	.fgx1 {
		width: 100%;
		height: 20rpx;
		background-color: #F5F5F9;
	}

	.group {
		padding: 6rpx 21rpx;
		background: #f1f7ff;
		border-radius: 6rpx;
		margin: 30rpx 30rpx 0 30rpx;
	}

	.button {
		width: 662rpx;
		margin: 130rpx auto 90rpx auto;
		background: #ab61ff;
		border-radius: 40rpx;
		border: 0;
		color: #fff;

		&.u-hairline-border:after {
			border: 0;
		}
	}

	.word {
		font-size: 36rpx;
		color: #0d1d36;
		font-weight: bold;
	}

	.list {
		// border: 1px solid;
		width: 690rpx;
		margin: 0 auto;
		background: #F8F8FC;
		border-radius: 20px;

		.title {
			font-size: 34rpx;
			color: #0E1E36;
			font-weight: bold;
		}


		image {
			width: 36rpx;
			height: 32rpx;
		}

		.u-cell {
			padding-left: 0;
			padding-right: 0;
		}

		.add {
			// width: 140rpx;
			height: 54rpx;
			line-height: 54rpx;
			border: 2rpx solid #FF9E21;
			border-radius: 27rpx;
			font-size: 30rpx;
			color: #FF9E21;
		}

		.yuanjiao {
			width: 32rpx;
			height: 32rpx;
			line-height: 32rpx;
			background: #AB61FF;
			border-radius: 50%;
			text-align: center;
			font-size: 22rpx;
			color: #FFFFFF;
			position: relative;
			top: 70rpx;

		}
	}

	.qtsm {
		display: flex;
		align-items: center;

		.hz {
			color: #0D1D36;
			font-size: 30rpx;
			margin-left: 15rpx;
		}
	}

	.zwpj {
		width: 690rpx;
		height: 260rpx;
		background-color: #F5F5F9;
		margin-top: 40rpx;
		font-size: 30rpx;
		color: #F5F5F9;
		border-radius: 10rpx;
		line-height: 44rpx;
	}
	.p-item {background-color: #fff;padding:30rpx 20rpx;}
</style>
